package com.zzyl.mapper;

import com.github.pagehelper.Page;
import com.zzyl.dto.NursingPlanPageQueryDto;
import com.zzyl.entity.NursingPlan;
import com.zzyl.vo.NursingPlanVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface NursingPlanMapper {
    /**
     * 添加
     * @param nursingPlan
     */
    void addNursingPlan(NursingPlan nursingPlan);

    /**
     * 根据名称和状态查询分页
     * @param dto
     * @return
     */
    Page<NursingPlanVo> PageQuery(NursingPlanPageQueryDto dto);

    /**
     * 根据id查询护理计划
     * @param id
     * @return
     */
    @Select("select * from nursing_plan where id = #{id}")
    NursingPlanVo selectById(Long id);

    /**
     *更新护理计划
     * @param nursingPlan
     */

    void updateNursingPlan(NursingPlan nursingPlan);

    /**
     * 根据id删除护理计划
     * @param id
     */
    @Delete("delete from nursing_plan where id = #{id}")
    void deleteNursingPlan(Long id);

    /**
     * 查询所有护理项目
     * @return
     */
    @Select("select * from nursing_plan where status=1")
    List<NursingPlanVo> getAll();


}
